Conversation
added 6 commits
May 14, 2020 18:05
This was
linked to
issues
May 18, 2020
Collaborator
Contributor
Author
Contributor
Co-authored-by: Brandon Waterloo [MSFT] <36966225+bwateratmsft@users.noreply.github.com>
bwateratmsft
approved these changes
May 19, 2020
karolz-ms
approved these changes
May 20, 2020
This was referenced May 27, 2020
Dmarch28
pushed a commit
to Dmarch28/vscode-docker
that referenced
this pull request
Mar 4, 2021
* Initial commit for debugpy launch instead of attach * Comments in the launcher + moving some stuff around * Use extraHosts + host.docker.internal in the custom launcher * Condition the host name based on host OS * Adding comments * Clean volume mapping logic for python * Update src/tasks/python/PythonExtensionHelper.ts Co-authored-by: Brandon Waterloo [MSFT] <36966225+bwateratmsft@users.noreply.github.com> Co-authored-by: Brandon Waterloo [MSFT] <36966225+bwateratmsft@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Here is how the flow of the launch request works:
(host) [VSCode] -> (host) [Debug Adapter] -> (host) [Custom launcher] -> (container) [Debugpy launcher] -> (container) [debugpy]
We added our own custom launcher which doesn't do much but pass the call to the real launcher in the container using a
docker execcommand.When debugpy gets the request, it connects back to VSCode on the specified host:port. For Windows/Mac, we use
host.docker.internal:{randomPort}, however this doesn't work for Linux. So we use the ip address from Docker's predefined network "bridge" and it works in all of the cases I tried (we might need to check with Docker so that we're not basing off wrong assumptions).The rest of the changes get rid of the attach logic we have.